1. Field of Invention
The present invention generally relates to a network address translation, and more particularly, to a method for accelerating the network address translation by processing the packet header.
2. Description of Related Art
The use of the Internet is growing more and more popular now; almost everyone experiences searching for information on the Internet, using e-mail to send/receive messages, and playing on-line games on network. With this situation of increased demand of using the Internet, multiple users in a family or at a company frequently want to access the Internet at the same time. The general Internet Service Provider (ISP), e.g. Hinet, provides only one IP (Internet Protocol) address; with this IP address, only one computer can connect to Internet. One IP address is limited to being used by only one computer at a time because the packet is sent to the Internet with this IP address, and the reply packet is also sent back by recognizing this IP address. If one IP address is used by two or more computers, the reply packet cannot determine which computer it should reply to. This, in turn, causes a big problem. Therefore, in order to have multiple computers access the Internet at the same time, it becomes necessary to request multiple IP addresses from the ISP. However, using the Internet is very costly, especially for the large organization that provides for hundreds or even thousands of employees. In such cases, the cost of using the Internet becomes a great burden. The problem worsens under the current scenario of the IP address of the Internet protocol currently used not being adequate to provide for the enormous growth of demands.
Several computers in the home or multiple internal computers at an office can communicate to external network via the same address by using an IP sharing device. Here the applicable principle is: the several computers in the home or the multiple internal computers at an office respectively form a Local Area Network (LAN) and communicate to the external Wide Area Network (WAN) via an IP sharing device. Referring to FIG. 1, the IP address (e.g. 140.112.233.246 shown in FIG. 1) provided by the Internet Service Provider (ISP) points to the IP sharing device, any packet transmitted to the IP address provided by the ISP is sent to the IP sharing device first, so that the packet is determined and transmitted to the computer inside the LAN that needs it. Each computer inside the LAN has its own private IP address, such as 192.168.1.2˜4 as shown in FIG. 1; these addresses are provided by the IP sharing device and can be used only inside this LAN. When any computer inside the LAN sends out one packet to the WAN, the packet is transmitted to outside via the IP sharing device. The source related data such as the virtual IP address recorded in packet is replaced by the IP address provided by the ISP by the IP sharing device since the virtual IP address used in the LAN cannot be recognized in the WAN. For example, the virtual IP address 192.168.1.2 inside the packet of the first computer shown in FIG. 1 is converted to the IP address 140.112.233.246 provided by the ISP, and the IP sharing device also records the information of which computer sends out this packet. Therefore, it is determined that such packet is sent out from the address owned by the IP sharing device. When the external WAN sends back the packet, the packet is also sent back to the IP sharing device. The packet can be appropriately sent back to the particular computer that needs this packet data with the information previously recorded by the IP sharing device. With such a conversion process, multiple computers can use the same address. Further, the internal data are also protected with this conversion process so that the network security is improved. Three segments are defined as the private IP address segment, they are respectively: 10.0.0.0 10.255.255.255, 172.16.0.0 172.31.255.255, and 192.168.0.0 192.168.255.255.
Multiple computers can communicate to the external network via the same IP address provided by the ISP. The IP sharing device currently used processes the mapping and conversion of the virtual IP address as well as the WAN IP address provided by the ISP. Relatively speaking, since the conversion speed in not fast enough, the transmitted packet data occasionally has to wait for the completion of the network address translation of the IP sharing device. Therefore, the network address translation in the prior art is processed by the hardware according to the present invention, and the method for translating the network address is also improved, so that the data transmission are not delayed due to the problem of the network address translation.